home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Networking / OTStreamLogViewer / IC Libraries / Internet Config APIs / InternetConfig.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-28  |  49.6 KB  |  1,259 lines  |  [TEXT/CWIE]

  1. /* •••Start Header••• */
  2.  
  3. /* File:         InternetConfig.h
  4.  * Generated by: 1.0d6
  5.  * For:          IC 2.0
  6.  * On:           Wednesday, 6 May 1998, 23:12:40
  7.  * 
  8.  * This file is part of the Internet Configuration system and
  9.  * is placed in the public domain for the benefit of all.
  10.  */
  11.  
  12. /* •••End Header••• */
  13.  
  14. /*
  15.     IMPORTANT NOTES ABOUT THE C HEADERS
  16.     -----------------------------------
  17.     
  18.     o     Pascal "var" parameters are converted from "var x : y" to "y *x".  This
  19.         means that when you see the parameter "y *x" you should be aware that
  20.         you *cannot pass in nil*.  In future this restriction may be eased,
  21.         especially for the attr parameter to ICGetPref.  Parameters where nil
  22.         is legal are declared using the explicit pointer type, ie "yPtr x".
  23.  
  24.     o     Strings are *Pascal* strings.  This means that they must be word aligned.
  25.         MPW and Think C do this automatically.  The last time I check, Metrowerks
  26.         C does not.  If it still doesn't, then IMHO it's a bug in their compiler
  27.         and you should report it to them.  [IC 1.4 and later no longer require
  28.         word aligned strings.  You can ignore this warning if you require IC 1.4
  29.         or greater.]
  30.  
  31.     o     The canonical Internet Config interface is defined in Pascal.  If there is a
  32.         conflict between these headers and the Pascal interfaces, the Pascal should
  33.         take precedence.  Please let me know if you find any problems.
  34. */
  35.  
  36. /* ********************************************************************************* */
  37.  
  38. #ifndef __INTERNETCONFIG__
  39. #define __INTERNETCONFIG__
  40.  
  41. #ifndef __TYPES__
  42. #include <Types.h>
  43. #endif
  44.  
  45. #ifndef __FILES__
  46. #include <Files.h>
  47. #endif
  48.  
  49. #ifndef __ALIASES__
  50. #include <Aliases.h>
  51. #endif
  52.  
  53. #ifndef __COMPONENTS__
  54. #include <Components.h>
  55. #endif
  56.  
  57. /* ********************************************************************************* */
  58.  
  59. #if PRAGMA_IMPORT_SUPPORTED
  60. #pragma import on
  61. #endif
  62.  
  63. #if PRAGMA_ALIGN_SUPPORTED
  64. #pragma options align=mac68k
  65. #endif
  66.  
  67. /* ********************************************************************************* */
  68.  
  69. enum {
  70.     icPrefNotFoundErr = -666,            /* preference not found (duh!) */
  71.     icPermErr = -667,                    /* cannot set preference */
  72.     icPrefDataErr = -668,                /* problem with preference data */
  73.     icInternalErr = -669,                /* hmm, this is not good */
  74.     icTruncatedErr = -670,                /* more data was present than was returned */
  75.     icNoMoreWritersErr = -671,            /* you cannot begin a write session because someone else is already doing it */
  76.     icNothingToOverrideErr = -672,        /* no component for the override component to capture */
  77.     icNoURLErr = -673,                    /* no URL found */
  78.     icConfigNotFoundErr = -674,            /* no configuration was found */
  79.     icConfigInappropriateErr = -675,    /* incorrect manufacturer code */
  80.     icProfileNotFoundErr = -676,        /* profile not found */
  81.     icTooManyProfilesErr = -677            /* too many profiles in database */
  82. };
  83.  
  84. enum {
  85.     ICattr_no_change = 0xFFFFFFFFL,                /* supply this to ICSetPref to tell it not to change the attributes */
  86.     ICattr_locked_bit = 0,                        /* bits in the preference attributes */
  87.     ICattr_locked_mask = 0x00000001L,            /* masks for the above */
  88.     ICattr_volatile_bit = 1,
  89.     ICattr_volatile_mask = 0x00000002L,
  90.     icNoUserInteraction_bit = 0,
  91.     icNoUserInteraction_mask = 0x00000001L
  92. };
  93.  
  94. #define ICfiletype 'ICAp'
  95. #define ICcreator 'ICAp'
  96.  
  97. #define ICdefault_file_name "\pInternet Preferences"    /* default file name, for internal use, overridden by a component resource */
  98.  
  99. struct ICDirSpec {                        /* a record that specifies a folder */
  100.     short vRefNum;
  101.     long dirID;
  102. };
  103. typedef struct ICDirSpec ICDirSpec;
  104.  
  105. typedef ICDirSpec ICDirSpecArray[4];    /* an array of the above */
  106. typedef ICDirSpec *ICDirSpecArrayPtr;    /* a pointer to that array */
  107.  
  108. typedef long ICAttr;                    /* type for preference attributes */
  109. typedef long ICError;                    /* type for error codes */
  110. typedef Ptr ICInstance;                    /* opaque type for preference reference */
  111.  
  112. enum {
  113.     icNoPerm = 0,
  114.     icReadOnlyPerm = 1,
  115.     icReadWritePerm = 2
  116. };
  117. typedef unsigned char ICPerm;
  118.  
  119. struct ICConfigRef {
  120.     OSType manufacturer;
  121.     /* other private data follows */
  122. };
  123. typedef struct ICConfigRef ICConfigRef, *ICConfigRefPtr, **ICConfigRefHandle;
  124.  
  125. enum {
  126.     kICNilProfileID = 0
  127. };
  128. typedef long ICProfileID, *ICProfileIDPtr;
  129.  
  130. enum {
  131.     kICEditPreferenceEventClass = 'ICAp',
  132.     kICEditPreferenceEvent = 'ICAp',
  133.     keyICEditPreferenceDestination = 'dest'
  134. };
  135.  
  136. /* •••Start ICKeys.h••• */
  137.  
  138. #define kICRealName "\pRealName"    /* PString -- real name of user */
  139. #define kICEmail "\pEmail"    /* PString -- user@host.domain, email address of user, ie return address */
  140. #define kICMailAccount "\pMailAccount"    /* PString -- user@host.domain, account from which to fetch mail */
  141. #define kICMailPassword "\pMailPassword"    /* PString -- scrambled, password for MailAccount */
  142. #define kICNewsAuthUsername "\pNewsAuthUsername"    /* PString -- user name for authorised news servers */
  143. #define kICNewsAuthPassword "\pNewsAuthPassword"    /* PString -- scrambled, password for NewsAuthUsername */
  144. #define kICArchiePreferred "\pArchiePreferred"    /* PString -- formatted, preferred Archie server */
  145. #define kICArchieAll "\pArchieAll"    /* STR# -- formatted, list of Archie servers */
  146. #define kICUMichPreferred "\pUMichPreferred"    /* PString -- formatted, preferred UMich server */
  147. #define kICUMichAll "\pUMichAll"    /* STR# -- formatted, list of UMich servers */
  148. #define kICInfoMacPreferred "\pInfoMacPreferred"    /* PString -- formatted, preferred Info-Mac server */
  149. #define kICInfoMacAll "\pInfoMacAll"    /* STR# -- formatted, list of Info-Mac servers */
  150. #define kICPhHost "\pPhHost"    /* PString -- host.domain, default Ph server */
  151. #define kICWhoisHost "\pWhoisHost"    /* PString -- host.domain, default whois server */
  152. #define kICFingerHost "\pFingerHost"    /* PString -- host.domain, default finger server */
  153. #define kICFTPHost "\pFTPHost"    /* PString -- host.domain, default FTP server */
  154. #define kICTelnetHost "\pTelnetHost"    /* PString -- host.domain, default Telnet address */
  155. #define kICSMTPHost "\pSMTPHost"    /* PString -- host.domain, SMTP server */
  156. #define kICNNTPHost "\pNNTPHost"    /* PString -- host.domain, NNTP server */
  157. #define kICGopherHost "\pGopherHost"    /* PString -- host.domain, default Gopher server */
  158. #define kICLDAPServer "\pLDAPServer"    /* PString -- host.domain */
  159. #define kICLDAPSearchbase "\pLDAPSearchbase"    /* PString -- string LDAP thing */
  160. #define kICWWWHomePage "\pWWWHomePage"    /* PString -- URL, users default WWW page */
  161. #define kICWAISGateway "\pWAISGateway"    /* PString -- no idea */
  162. #define kICListFont "\pListFont"    /* ICFontRecord -- font used for lists of items (eg news article lists) */
  163. #define kICScreenFont "\pScreenFont"    /* ICFontRecord -- font used for monospaced text (eg news articles) */
  164. #define kICDocumentFont "\pDocumentFont"    /* ICFontRecord -- font used for proportional text */
  165. #define kICPrinterFont "\pPrinterFont"    /* ICFontRecord -- font used to print ScreenFont */
  166. #define kICDownloadFolder "\pDownloadFolder"    /* ICFileSpec -- where to put newly downloaded files */
  167. #define kICSignature "\pSignature"    /* TEXT -- append to news and mail messages */
  168. #define kICOrganization "\pOrganization"    /* PString -- for X-Organization string */
  169. #define kICPlan "\pPlan"    /* TEXT -- default response for finger servers */
  170. #define kICQuotingString "\pQuotingString"    /* PString -- used to quote responses in news and mail */
  171. #define kICMailHeaders "\pMailHeaders"    /* TEXT -- extra headers for mail messages */
  172. #define kICNewsHeaders "\pNewsHeaders"    /* TEXT -- extra headers for news messages */
  173. #define kICMapping "\pMapping"    /* ICMapEntries -- file type mapping, see documentation */
  174. #define kICCharacterSet "\pCharacterSet"    /* ICCharTable -- Mac-to-Net and Net-to-Mac character translation */
  175. #define kICHelper "\pHelper•"    /* ICAppSpec -- helpers for URL schemes */
  176. #define kICServices "\pServices"    /* ICServices -- TCP and IP port-to-name mapping */
  177. #define kICNewMailFlashIcon "\pNewMailFlashIcon"    /* Boolean -- how to announce new mail */
  178. #define kICNewMailDialog "\pNewMailDialog"    /* Boolean */
  179. #define kICNewMailPlaySound "\pNewMailPlaySound"    /* Boolean */
  180. #define kICNewMailSoundName "\pNewMailSoundName"    /* PString */
  181. #define kICWebBackgroundColour "\pWebBackgroundColour"    /* RGBColor -- background colour for web pages */
  182. #define kICNoProxyDomains "\pNoProxyDomains"    /* STR# -- list of domains not to be proxied */
  183. #define kICUseSocks "\pUseSocks"    /* Boolean */
  184. #define kICSocksHost "\pSocksHost"    /* PString -- host.domain, remember that host.domain format allows ":port" and " port" */
  185. #define kICUseHTTPProxy "\pUseHTTPProxy"    /* Boolean */
  186. #define kICHTTPProxyHost "\pHTTPProxyHost"    /* PString -- host.domain */
  187. #define kICUseGopherProxy "\pUseGopherProxy"    /* Boolean */
  188. #define kICGopherProxy "\pGopherProxy"    /* PString -- host.domain, see note in Prog Docs */
  189. #define kICUseFTPProxy "\pUseFTPProxy"    /* Boolean */
  190. #define kICFTPProxyHost "\pFTPProxyHost"    /* PString -- host.domain */
  191. #define kICFTPProxyUser "\pFTPProxyUser"    /* PString -- first level FTP proxy authorisation */
  192. #define kICFTPProxyPassword "\pFTPProxyPassword"    /* PString -- scrambled, password for FTPProxyUser */
  193. #define kICFTPProxyAccount "\pFTPProxyAccount"    /* PString -- second level FTP proxy authorisation */
  194. #define kICUsePassiveFTP "\pUsePassiveFTP"    /* Boolean -- use PASV command for FTP transfers */
  195. #define kICSnailMailAddress "\pSnailMailAddress"    /* TEXT -- preferred mailing address */
  196. #define kICMacSearchHost "\pMacSearchHost"    /* PString -- host for MacSearch queries */
  197. #define kICWebSearchPagePrefs "\pWebSearchPagePrefs"    /* PString -- URL, users default search page */
  198. #define kICWebTextColor "\pWebTextColor"    /* RGBColor -- colour for normal text */
  199. #define kICWebReadColor "\p646F6777•WebReadColor"    /* RGBColor -- colour for read links */
  200. #define kICWebUnreadColor "\p646F6777•WebUnreadColor"    /* RGBColor -- colour for unread links */
  201. #define kICWebUnderlineLinks "\p646F6777•WebUnderlineLinks"    /* Boolean -- whether to underline links */
  202. #define kICNTPHost "\pNTPHost"    /* PString -- host.domain, Network Time Protocol (NTP) */
  203. #define kICIRCHost "\pIRCHost"    /* PString -- host.domain, Internet Relay Chat server */
  204. #define kICHelperList "\pHelperList•"    /* ICAppSpecList -- list of common helpers for URL schemes */
  205. #define kICHelperDesc "\pHelperDesc•"    /* PString -- description for URL scheme */
  206.  
  207. /* •••End ICKeys.h••• */
  208.  
  209. struct ICFontRecord {
  210.     short size;
  211.     Style face;
  212.     char pad;
  213.     Str255 font;
  214. };
  215. typedef struct ICFontRecord ICFontRecord, *ICFontRecordPtr, **ICFontRecordHandle;
  216.  
  217. struct ICCharTable {
  218.     unsigned char net_to_mac[256];
  219.     unsigned char mac_to_net[256];
  220. };
  221. typedef struct ICCharTable ICCharTable, *ICCharTablePtr, **ICCharTableHandle;
  222.  
  223. struct ICAppSpec {
  224.     OSType fCreator;
  225.     Str63 name;
  226. };
  227. typedef struct ICAppSpec ICAppSpec, *ICAppSpecPtr, **ICAppSpecHandle;
  228.  
  229. struct ICAppSpecList {
  230.     short numberOfItems;
  231.     ICAppSpec appSpecs[1];
  232. };
  233. typedef struct ICAppSpecList ICAppSpecList, *ICAppSpecListPtr, **ICAppSpecListHandle;
  234.  
  235. #if OLDROUTINENAMES
  236.         
  237. /*    ICFileInfo was originally used to define the format of a key.
  238.     That key was removed, but we forgot to remove ICFileInfo.
  239.     I hope to remove it entirely, but for the moment it's available
  240.     if you define OLDROUTINENAMES.
  241. */
  242.  
  243. struct ICFileInfo {
  244.     OSType fType;
  245.     OSType fCreator;
  246.     Str63 name;
  247. };
  248. typedef struct ICFileInfo ICFileInfo, *ICFileInfoPtr, **ICFileInfoHandle;
  249.  
  250. #endif
  251.  
  252. struct ICFileSpec {
  253.     Str31 vol_name;
  254.     long vol_creation_date;
  255.     FSSpec fss;
  256.     AliasRecord alias;
  257.     /* plus extra data, aliasSize 0 means no alias manager present when
  258.             ICFileSpecification was created */
  259. };
  260. typedef struct ICFileSpec ICFileSpec, *ICFileSpecPtr, **ICFileSpecHandle;
  261.  
  262. enum {
  263.     ICfile_spec_header_size = sizeof(ICFileSpec) - sizeof(AliasRecord)
  264. };
  265.  
  266. struct ICMapEntry {
  267.     short total_length;
  268.     short fixed_length;
  269.     short version;
  270.     OSType file_type;
  271.     OSType file_creator;
  272.     OSType post_creator;
  273.     long flags;
  274.     /* variable part starts here */
  275.     Str255 extension;
  276.     Str255 creator_app_name;
  277.     Str255 post_app_name;
  278.     Str255 MIME_type;
  279.     Str255 entry_name;
  280. };
  281. typedef struct ICMapEntry ICMapEntry, *ICMapEntryPtr, **ICMapEntryHandle;
  282.  
  283. enum {
  284.     ICmap_binary_bit = 0,                    /* file should be transfered in binary as opposed to text mode */
  285.     ICmap_binary_mask = 0x00000001,
  286.     ICmap_resource_fork_bit = 1,            /* the resource fork of the file is significant */
  287.     ICmap_resource_fork_mask = 0x00000002,
  288.     ICmap_data_fork_bit = 2,                /* the data fork of the file is significant */
  289.     ICmap_data_fork_mask = 0x00000004,
  290.  
  291.     ICmap_post_bit = 3,                        /* post process using post fields */
  292.     ICmap_post_mask = 0x00000008,
  293.  
  294.     ICmap_not_incoming_bit = 4,                /* ignore this mapping for incoming files */
  295.     ICmap_not_incoming_mask = 0x00000010,
  296.     ICmap_not_outgoing_bit = 5,                /* ignore this mapping for outgoing files */
  297.     ICmap_not_outgoing_mask = 0x00000020,
  298.  
  299.     ICmap_fixed_length = 22                    /* number in fixed_length field */
  300. };
  301.  
  302. struct ICServiceEntry {
  303.     Str255 name;
  304.     short port;
  305.     short flags;
  306. };
  307. typedef struct ICServiceEntry ICServiceEntry, *ICServiceEntryPtr, **ICServiceEntryHandle;
  308.  
  309. struct ICServices {
  310.     short count;
  311.     ICServiceEntry services[1];
  312. };
  313. typedef struct ICServices ICServices, *ICServicesPtr, **ICServicesHandle;
  314.  
  315. enum {
  316.     ICservices_tcp_bit = 0,
  317.     ICservices_tcp_mask = 0x00000001,
  318.     ICservices_udp_bit = 1,
  319.     ICservices_udp_mask = 0x00000002
  320.     /* both bits can be set, which means the service is both TCP and UDP, eg daytime */
  321. };
  322.  
  323. /* ***** Notes Relevant To All API Routines ***** */
  324.  
  325. /*
  326.     [r1] Requires IC 1.1 or higher.
  327.     [r2] Requires IC 1.2 or higher.
  328.     [r3] Requires IC 2.0 or higher.
  329.     
  330.     [c1] You must have specified a configuration before
  331.          calling this routine.
  332.     [c2] You must have specified the default configuration
  333.          before calling this routine.
  334.     [c3] You do not need to specify a configuration before
  335.          calling this routine.
  336.  
  337.     [b1] You must be inside a Begin/End pair when calling
  338.          this routine.
  339.     [b2] You must be inside a Begin/End read/write pair when
  340.          calling this routine.
  341.     [b3] You do not need to be inside a Begin/End pair when
  342.           calling this routine.
  343.     [b4] If you are getting or setting multiple preferences,
  344.          you should make this call inside a Begin/End pair.
  345.          If you do not make this call inside a Begin/End pair,
  346.          the call will automatically do it for you.
  347.     [b5] It is illegal to call this routine inside a
  348.          Begin/End pair.
  349. */
  350.  
  351. #ifdef __cplusplus
  352. extern "C" {
  353. #endif
  354.  
  355. /* •••Start ICAPI.h••• */
  356.  
  357. /* ***** Starting Up and Shutting Down ***** */
  358.  
  359. pascal ICError ICStart(ICInstance *inst, OSType creator);
  360.   /* Call this at application initialisation. Set creator to your application
  361.    * creator to allow for future expansion of the IC system. Returns
  362.    * inst as a connection to the IC system.
  363.    */
  364.  
  365. pascal ICError ICStop(ICInstance inst);
  366.   /* [b5] 
  367.    * Call this at application initialisation, after which inst
  368.    * is no longer valid connection to IC.
  369.    */
  370.  
  371. /* ***** Specifying a Configuration ***** */
  372.  
  373. pascal ICError ICFindConfigFile(ICInstance inst, short count, ICDirSpecArrayPtr folders)
  374. FIVEWORDINLINE(0x2F3C, 6, 2, 0x7000, 0xA82A);
  375.   /* [b5] 
  376.    * Call to configure this connection to IC.
  377.    * Set count as the number of valid elements in folders.
  378.    * Set folders to a pointer to the folders to search.
  379.    * Setting count to 0 and folders to nil is OK.
  380.    * Searches the specified folders and then the Preferences folder
  381.    * in a unspecified manner.
  382.    */
  383.  
  384. pascal ICError ICFindUserConfigFile(ICInstance inst, ICDirSpec *where)
  385. FIVEWORDINLINE(0x2F3C, 4, 14, 0x7000, 0xA82A);
  386.   /* [r1] [b5] 
  387.    * Similar to ICFindConfigFile except that it only searches the folder
  388.    * specified in where.  If the input parameters are valid the routine
  389.    * will always successful configure the instance, creating an
  390.    * empty configuration if necessary
  391.    * For use with double-clickable preference files.
  392.    */
  393.  
  394. pascal ICError ICGeneralFindConfigFile(ICInstance inst, Boolean searchPrefs, Boolean canCreate, short count, ICDirSpecArrayPtr folders)
  395. FIVEWORDINLINE(0x2F3C, 10, 30, 0x7000, 0xA82A);
  396.   /* [r2] [b5] 
  397.    * Call to configure this connection to IC.
  398.    * This routine acts as a more general replacement for
  399.    * ICFindConfigFile and ICFindUserConfigFile.
  400.    * Set search_prefs to true if you want it to search the preferences folder.
  401.    * Set can_create to true if you want it to be able to create a new config.
  402.    * Set count as the number of valid elements in folders.
  403.    * Set folders to a pointer to the folders to search.
  404.    * Setting count to 0 and folders to nil is OK.
  405.    * Searches the specified folders and then optionally the Preferences folder
  406.    * in a unspecified manner.
  407.    */
  408.  
  409. pascal ICError ICChooseConfig(ICInstance inst)
  410. FIVEWORDINLINE(0x2F3C, 0, 33, 0x7000, 0xA82A);
  411.   /* [r2] [b5] 
  412.    * Requests the user to choose a configuration, typically using some
  413.    * sort of modal dialog. If the user cancels the dialog the configuration
  414.    * state will be unaffected.
  415.    */
  416.  
  417. pascal ICError ICChooseNewConfig(ICInstance inst)
  418. FIVEWORDINLINE(0x2F3C, 0, 34, 0x7000, 0xA82A);
  419.   /* [r2] [b5] 
  420.    * Requests the user to create a new configuration, typically using some
  421.    * sort of modal dialog. If the user cancels the dialog the configuration
  422.    * state will be unaffected.
  423.    */
  424.  
  425. pascal ICError ICGetConfigName(ICInstance inst, Boolean longname, Str255 name)
  426. FIVEWORDINLINE(0x2F3C, 6, 35, 0x7000, 0xA82A);
  427.   /* [r2] [c1] [b3] 
  428.    * Returns a string that describes the current configuration at a user
  429.    * level. Set longname to true if you want a long name, up to 255
  430.    * characters, or false if you want a short name, typically about 32
  431.    * characters.
  432.    * The returned string is for user display only. If you rely on the
  433.    * exact format of it, you will conflict with any future IC
  434.    * implementation that doesn't use explicit preference files.
  435.    */
  436.  
  437. pascal ICError ICGetConfigReference(ICInstance inst, ICConfigRefHandle ref)
  438. FIVEWORDINLINE(0x2F3C, 4, 31, 0x7000, 0xA82A);
  439.   /* [r2] [c1] [b3] 
  440.    * Returns a self-contained reference to the instance's current
  441.    * configuration.
  442.    * ref must be a valid non-nil handle and it will be resized to fit the
  443.    * resulting data.
  444.    */
  445.  
  446. pascal ICError ICSetConfigReference(ICInstance inst, ICConfigRefHandle ref, long flags)
  447. FIVEWORDINLINE(0x2F3C, 8, 32, 0x7000, 0xA82A);
  448.   /* [r2] [b5] 
  449.    * Reconfigures the instance using a configuration reference that was
  450.    * got using ICGetConfigReference reference. Set the
  451.    * icNoUserInteraction_bit in flags if you require that this routine
  452.    * not present a modal dialog. Other flag bits are reserved and should
  453.    * be set to zero.
  454.    * ref must not be nil.
  455.    */
  456.  
  457. /* ***** Private Routines *****
  458.  * 
  459.  * If you are calling these routines, you are most probably doing something
  460.  * wrong.  Please read the documentation for more details.
  461.  */
  462.  
  463. pascal ICError ICSpecifyConfigFile(ICInstance inst, FSSpec *config)
  464. FIVEWORDINLINE(0x2F3C, 4, 3, 0x7000, 0xA82A);
  465.   /* [b5] 
  466.    * For use only by the IC application.
  467.    * If you call this routine yourself, you will conflict with any
  468.    * future IC implementation that doesn't use explicit preference files.
  469.    */
  470.  
  471. pascal ICError ICRefreshCaches(ICInstance inst)
  472. FIVEWORDINLINE(0x2F3C, 0, 47, 0x7000, 0xA82A);
  473.   /* [r3] [c1] [b3] 
  474.    * For use only by the IC application.
  475.    * If you call this routine yourself, you will conflict with any
  476.    * future IC implementation that doesn't use explicit preference files.
  477.    */
  478.  
  479. /* ***** Getting Information ***** */
  480.  
  481. pascal ICError ICGetSeed(ICInstance inst, long *seed)
  482. FIVEWORDINLINE(0x2F3C, 4, 4, 0x7000, 0xA82A);
  483.   /* [c3] [b3] 
  484.    * Returns the current seed for the IC prefs database.
  485.    * This seed changes each time a non-volatile preference is changed.
  486.    * You can poll this to determine if any cached preferences change.
  487.    */
  488.  
  489. pascal ICError ICGetPerm(ICInstance inst, ICPerm *perm)
  490. FIVEWORDINLINE(0x2F3C, 4, 13, 0x7000, 0xA82A);
  491.   /* [c3] [b3] 
  492.    * Returns the access permissions currently associated with this instance.
  493.    * While applications normally know what permissions they have,
  494.    * this routine is designed for use by override components.
  495.    */
  496.  
  497. pascal ICError ICDefaultFileName(ICInstance inst, Str63 name)
  498. FIVEWORDINLINE(0x2F3C, 4, 11, 0x7000, 0xA82A);
  499.   /* [c3] [b3] 
  500.    * Returns the default file name for IC preference files.
  501.    * Applications should never need to call this routine.
  502.    * If you rely on information returned by this routine yourself,
  503.    * you may conflict with any future IC implementation that doesn't use
  504.    * explicit preference files.
  505.    * The component calls this routine to set up the default IC file name.
  506.    * This allows this operation to be intercepted by a component that has
  507.    * captured us. It currently gets it from the component resource file.
  508.    * The glue version is hardwired to "Internet Preferences".
  509.    */
  510.  
  511. pascal ICError ICGetComponentInstance(ICInstance inst, ComponentInstance *componentInst);
  512.   /* [r3] [c3] [b3] 
  513.    * Returns noErr and the connection to the IC component,
  514.    * if we're using the component.
  515.    * Returns badComponenInstance and nil if we're operating with glue.
  516.    */
  517.  
  518. /* ***** Reading and Writing Preferences ***** */
  519.  
  520. pascal ICError ICBegin(ICInstance inst, ICPerm perm)
  521. FIVEWORDINLINE(0x2F3C, 2, 5, 0x7000, 0xA82A);
  522.   /* [c1] [b5] 
  523.    * Starting reading or writing multiple preferences.
  524.    * A call to this must be balanced by a call to ICEnd.
  525.    * Do not call WaitNextEvent between these calls.
  526.    * The perm specifies whether you intend to read or read/write.
  527.    * Only one writer is allowed per instance.
  528.    * Note that this may open resource files that are not closed
  529.    * until you call ICEnd.
  530.    */
  531.  
  532. pascal ICError ICGetPref(ICInstance inst, ConstStr255Param key, ICAttr *attr, Ptr buf, long *size)
  533. FIVEWORDINLINE(0x2F3C, 16, 6, 0x7000, 0xA82A);
  534.   /* [c1] [b4] 
  535.    * Reads the preference specified by key from the IC database to the
  536.    * buffer pointed to by buf and size.
  537.    * key must not be the empty string.
  538.    * If buf is nil then no data is returned.
  539.    * size must be non-negative.
  540.    * attr and size are always set on return. On errors (except icTruncatedErr)
  541.    * attr is set to ICattr_no_change and size is set to 0.
  542.    * size is the actual size of the data.
  543.    * attr is set to the attributes associated with the preference.
  544.    * If this routine returns icTruncatedErr then the other returned
  545.    * values are valid except that only the first size bytes have been
  546.    * return. size is adjusted to reflect the true size of the preference.
  547.    * Returns icPrefNotFound if there is no preference for the key.
  548.    */
  549.  
  550. pascal ICError ICSetPref(ICInstance inst, ConstStr255Param key, ICAttr attr, Ptr buf, long size)
  551. FIVEWORDINLINE(0x2F3C, 16, 7, 0x7000, 0xA82A);
  552.   /* [c1] [b4] 
  553.    * Sets the preference specified by key from the IC database to the
  554.    * value pointed to by buf and size.
  555.    * key must not be the empty string.
  556.    * size must be non-negative. 
  557.    * If buf is nil then the preference value is not set and size is ignored.
  558.    * If buf is not nil then the preference value is set to the size
  559.    * bytes pointed to by buf.
  560.    * If attr is ICattr_no_change then the preference attributes are not set.
  561.    * Otherwise the preference attributes are set to attr.
  562.    * Returns icPermErr if the previous ICBegin was passed icReadOnlyPerm.
  563.    * Returns icPermErr if current attr is locked, new attr is locked and buf <> nil.
  564.    */
  565.  
  566. pascal ICError ICFindPrefHandle(ICInstance inst, ConstStr255Param key, ICAttr *attr, Handle prefh)
  567. FIVEWORDINLINE(0x2F3C, 12, 36, 0x7000, 0xA82A);
  568.   /* [r2] [c1] [b4] 
  569.    * This routine effectively replaces ICGetPrefHandle.
  570.    * Reads the preference specified by key from the IC database into
  571.    * a handle, prefh.
  572.    * key must not be the empty string.
  573.    * attr is set to the attributes associated with the preference.
  574.    * You must set prefh to a non-nil handle before calling this routine.
  575.    * If the preference does not exist, icPrefNotFoundErr is returned.
  576.    */
  577.  
  578. pascal ICError ICGetPrefHandle(ICInstance inst, ConstStr255Param key, ICAttr *attr, Handle *prefh)
  579. FIVEWORDINLINE(0x2F3C, 12, 26, 0x7000, 0xA82A);
  580.   /* [r1] [c1] [b4] 
  581.    * This routine is now obsolete. Use ICFindPrefHandle instead.
  582.    * Reads the preference specified by key from the IC database into
  583.    * a newly created handle, prefh.
  584.    * key must not be the empty string.
  585.    * attr is set to the attributes associated with the preference.
  586.    * The incoming value of prefh is ignored.
  587.    * A new handle is created in the current heap and returned in prefh.
  588.    * If the routine returns an error, prefh is set to nil.
  589.    * If the preference does not exist, no error is returned and prefh is set
  590.    * to an empty handle.
  591.    */
  592.  
  593. pascal ICError ICSetPrefHandle(ICInstance inst, ConstStr255Param key, ICAttr attr, Handle prefh)
  594. FIVEWORDINLINE(0x2F3C, 12, 27, 0x7000, 0xA82A);
  595.   /* [r1] [c1] [b4] 
  596.    * Sets the preference specified by key from the IC database to the
  597.    * value contained in prefh.
  598.    * key must not be the empty string.
  599.    * If prefh is nil then the preference value is not set.
  600.    * If buf is not nil then the preference value is set to the data
  601.    * contained in it.
  602.    * If attr is ICattr_no_change then the preference attributes are not set.
  603.    * Otherwise the preference attributes are set to attr.
  604.    * Returns icPermErr if the previous ICBegin was passed icReadOnlyPerm.
  605.    * Returns icPermErr if current attr is locked, new attr is locked and prefh <> nil.
  606.    */
  607.  
  608. pascal ICError ICCountPref(ICInstance inst, long *count)
  609. FIVEWORDINLINE(0x2F3C, 4, 8, 0x7000, 0xA82A);
  610.   /* [c1] [b1] 
  611.    * Counts the total number of preferences.
  612.    * If the routine returns an error, count is set to 0.
  613.    */
  614.  
  615. pascal ICError ICGetIndPref(ICInstance inst, long index, Str255 key)
  616. FIVEWORDINLINE(0x2F3C, 8, 9, 0x7000, 0xA82A);
  617.   /* [c1] [b1] 
  618.    * Returns the key of the index'th preference.
  619.    * index must be positive.
  620.    * Returns icPrefNotFoundErr if index is greater than the total number of preferences.
  621.    * If the routine returns an error, key is undefined.
  622.    */
  623.  
  624. pascal ICError ICDeletePref(ICInstance inst, ConstStr255Param key)
  625. FIVEWORDINLINE(0x2F3C, 4, 12, 0x7000, 0xA82A);
  626.   /* [c1] [b2] 
  627.    * Deletes the preference specified by key.
  628.    * key must not be the empty string.
  629.    * Returns icPrefNotFound if the preference specified by key is not present.
  630.    */
  631.  
  632. pascal ICError ICEnd(ICInstance inst)
  633. FIVEWORDINLINE(0x2F3C, 0, 10, 0x7000, 0xA82A);
  634.   /* [c1] [b1] 
  635.    * Terminates a preference session, as started by ICBegin.
  636.    * You must have called ICBegin before calling this routine.
  637.    */
  638.  
  639. /* ***** User Interface Stuff ***** */
  640.  
  641. pascal ICError ICEditPreferences(ICInstance inst, ConstStr255Param key)
  642. FIVEWORDINLINE(0x2F3C, 4, 15, 0x7000, 0xA82A);
  643.   /* [r1] [c1] [b3] 
  644.    * Instructs IC to display the user interface associated with editing
  645.    * preferences and focusing on the preference specified by key.
  646.    * If key is the empty string then no preference should be focused upon.
  647.    * You must have specified a configuration before calling this routine.
  648.    * You do not need to call ICBegin before calling this routine.
  649.    * In the current implementation this launches the IC application
  650.    * (or brings it to the front) and displays the window containing
  651.    * the preference specified by key.
  652.    * It may have a radically different implementation in future
  653.    * IC systems.
  654.    */
  655.  
  656. /* ***** URL Handling ***** */
  657.  
  658. pascal ICError ICParseURL(ICInstance inst, ConstStr255Param hint, Ptr data, long len, long *selStart, long *selEnd, Handle url)
  659. FIVEWORDINLINE(0x2F3C, 24, 16, 0x7000, 0xA82A);
  660.   /* [r1] [c1] [b3] 
  661.    * Parses a URL out of the specified text and returns it in a canonical form
  662.    * in a handle.
  663.    * hint indicates the default scheme for URLs of the form "name@address".
  664.    * If hint is the empty string then URLs of that form are not allowed.
  665.    * data points to the start of the text. It must not be nil.
  666.    * len indicates the length of the text. It must be non-negative.
  667.    * selStart and selEnd should be passed in as the current selection of
  668.    * the text. This selection is given in the same manner as TextEdit,
  669.    * ie if selStart = selEnd then there is no selection only an insertion
  670.    * point. Also selStart ≤ selEnd and 0 ≤ selStart ≤ len and 0 ≤ selEnd ≤ len.
  671.    * selStart and selEnd are returned as the bounds of the URL. If the
  672.    * routine returns an error then these new boundaries may be
  673.    * invalid but they will be close.
  674.    * The incoming url handle must not be nil.  The resulting URL is normalised
  675.    * and copied into the url handle, which is resized to fit.
  676.    */
  677.  
  678. pascal ICError ICLaunchURL(ICInstance inst, ConstStr255Param hint, Ptr data, long len, long *selStart, long *selEnd)
  679. FIVEWORDINLINE(0x2F3C, 20, 17, 0x7000, 0xA82A);
  680.   /* [r1] [c1] [b3] 
  681.    * Parses a URL out of the specified text and feeds it off to the
  682.    * appropriate helper.
  683.    * hint indicates the default scheme for URLs of the form "name@address".
  684.    * If hint is the empty string then URLs of that form are not allowed.
  685.    * data points to the start of the text. It must not be nil.
  686.    * len indicates the length of the text. It must be non-negative.
  687.    * selStart and selEnd should be passed in as the current selection of
  688.    * the text. This selection is given in the same manner as TextEdit,
  689.    * ie if selStart = selEnd then there is no selection only an insertion
  690.    * point. Also selStart ≤ selEnd and 0 ≤ selStart ≤ len and 0 ≤ selEnd ≤ len.
  691.    * selStart and selEnd are returned as the bounds of the URL. If the
  692.    * routine returns an error then these new boundaries may be
  693.    * invalid but they will be close.
  694.    * The URL is parsed out of the text and passed off to the appropriate
  695.    * helper using the GURL AppleEvent.
  696.    */
  697.  
  698. /* ***** Mappings Routines *****
  699.  * 
  700.  * Routines for interrogating mappings database.
  701.  * 
  702.  * ----- High Level Routines -----
  703.  */
  704.  
  705. pascal ICError ICMapFilename(ICInstance inst, ConstStr255Param filename, ICMapEntry *entry)
  706. FIVEWORDINLINE(0x2F3C, 8, 24, 0x7000, 0xA82A);
  707.   /* [r1] [c1] [b4] 
  708.    * Takes the name of an incoming file and returns the most appropriate
  709.    * mappings database entry, based on its extension.
  710.    * filename must not be the empty string.
  711.    * Returns icPrefNotFoundErr if no suitable entry is found.
  712.    */
  713.  
  714. pascal ICError ICMapTypeCreator(ICInstance inst, OSType fType, OSType fCreator, ConstStr255Param filename, ICMapEntry *entry)
  715. FIVEWORDINLINE(0x2F3C, 16, 25, 0x7000, 0xA82A);
  716.   /* [r1] [c1] [b4] 
  717.    * Takes the type and creator (and optionally the name) of an outgoing
  718.    * file and returns the most appropriate mappings database entry.
  719.    * The filename may be either the name of the outgoing file or
  720.    * the empty string.
  721.    * Returns icPrefNotFoundErr if no suitable entry found.
  722.    */
  723.  
  724. /* ----- Mid Level Routines ----- */
  725.  
  726. pascal ICError ICMapEntriesFilename(ICInstance inst, Handle entries, ConstStr255Param filename, ICMapEntry *entry)
  727. FIVEWORDINLINE(0x2F3C, 12, 28, 0x7000, 0xA82A);
  728.   /* [r1] [c1] [b3] 
  729.    * Takes the name of an incoming file and returns the most appropriate
  730.    * mappings database entry, based on its extension.
  731.    * entries must be a handle to a valid IC mappings database preference.
  732.    * filename must not be the empty string.
  733.    * Returns icPrefNotFoundErr if no suitable entry is found.
  734.    */
  735.  
  736. pascal ICError ICMapEntriesTypeCreator(ICInstance inst, Handle entries, OSType fType, OSType fCreator, ConstStr255Param filename, ICMapEntry *entry)
  737. FIVEWORDINLINE(0x2F3C, 20, 29, 0x7000, 0xA82A);
  738.   /* [r1] [c1] [b3] 
  739.    * Takes the type and creator (and optionally the name) of an outgoing
  740.    * file and returns the most appropriate mappings database entry.
  741.    * entries must be a handle to a valid IC mappings database preference.
  742.    * The filename may be either the name of the outgoing file or
  743.    * the empty string.
  744.    * Returns icPrefNotFoundErr if no suitable entry found.
  745.    */
  746.  
  747. /* ----- Low Level Routines ----- */
  748.  
  749. pascal ICError ICCountMapEntries(ICInstance inst, Handle entries, long *count)
  750. FIVEWORDINLINE(0x2F3C, 8, 18, 0x7000, 0xA82A);
  751.   /* [r1] [c1] [b3] 
  752.    * Counts the number of entries in the mappings database.
  753.    * entries must be a handle to a valid IC mappings database preference.
  754.    * count is set to the number of entries.
  755.    */
  756.  
  757. pascal ICError ICGetIndMapEntry(ICInstance inst, Handle entries, long index, long *pos, ICMapEntry *entry)
  758. FIVEWORDINLINE(0x2F3C, 16, 19, 0x7000, 0xA82A);
  759.   /* [r1] [c1] [b3] 
  760.    * Gets the index'th entry in the mappings database.
  761.    * entries must be a handle to a valid IC mappings database preference.
  762.    * index must be in the range from 1 to the number of entries in the database.
  763.    * The value of pos is ignored on input. pos is set to the position of
  764.    * the index'th entry in the database and is suitable for passing back
  765.    * into ICSetMapEntry.
  766.    * Does not return any user data associated with the entry.
  767.    */
  768.  
  769. pascal ICError ICGetMapEntry(ICInstance inst, Handle entries, long pos, ICMapEntry *entry)
  770. FIVEWORDINLINE(0x2F3C, 12, 20, 0x7000, 0xA82A);
  771.   /* [r1] [c1] [b3] 
  772.    * Returns the entry located at position pos in the mappings database.
  773.    * entries must be a handle to a valid IC mappings database preference.
  774.    * pos should be 0 to get the first entry. To get the subsequent entries, add
  775.    * entry.total_size to pos and iterate.
  776.    * Does not return any user data associated with the entry.
  777.    */
  778.  
  779. pascal ICError ICSetMapEntry(ICInstance inst, Handle entries, long pos, ICMapEntry *entry)
  780. FIVEWORDINLINE(0x2F3C, 12, 21, 0x7000, 0xA82A);
  781.   /* [r1] [c1] [b3] 
  782.    * Sets the entry located at position pos in the mappings database.
  783.    * entries must be a handle to a valid IC mappings database preference.
  784.    * pos should be either a value returned from ICGetIndMapEntry or a value
  785.    * calculated using ICGetMapEntry.
  786.    * entry is a var parameter purely for stack space reasons. It is not
  787.    * modified in any way.
  788.    * Any user data associated with the entry is unmodified.
  789.    */
  790.  
  791. pascal ICError ICDeleteMapEntry(ICInstance inst, Handle entries, long pos)
  792. FIVEWORDINLINE(0x2F3C, 8, 22, 0x7000, 0xA82A);
  793.   /* [r1] [c1] [b3] 
  794.    * Deletes the mappings database entry at pos.
  795.    * entries must be a handle to a valid IC mappings database preference.
  796.    * pos should be either a value returned from ICGetIndMapEntry or a value
  797.    * calculated using ICGetMapEntry.
  798.    * Also deletes any user data associated with the entry.
  799.    */
  800.  
  801. pascal ICError ICAddMapEntry(ICInstance inst, Handle entries, ICMapEntry *entry)
  802. FIVEWORDINLINE(0x2F3C, 8, 23, 0x7000, 0xA82A);
  803.   /* [r1] [c1] [b3] 
  804.    * Adds an entry to the mappings database.
  805.    * entries must be a handle to a valid IC mappings database preference.
  806.    * The entry is added to the end of the entries database.
  807.    * No user data is added.
  808.    */
  809.  
  810. /* ***** Profile Management Routines ***** */
  811.  
  812. pascal ICError ICGetCurrentProfile(ICInstance inst, ICProfileID *currentID)
  813. FIVEWORDINLINE(0x2F3C, 4, 37, 0x7000, 0xA82A);
  814.   /* [r3] [c1] [b3] 
  815.    * Returns the profile ID of the current profile.
  816.    */
  817.  
  818. pascal ICError ICSetCurrentProfile(ICInstance inst, ICProfileID newID)
  819. FIVEWORDINLINE(0x2F3C, 4, 38, 0x7000, 0xA82A);
  820.   /* [r3] [c1] [b3] 
  821.    * Sets the current profile to the profile specified in newProfile.
  822.    */
  823.  
  824. pascal ICError ICCountProfiles(ICInstance inst, long *count)
  825. FIVEWORDINLINE(0x2F3C, 4, 39, 0x7000, 0xA82A);
  826.   /* [r3] [c1] [b1] 
  827.    * Returns the total number of profiles.
  828.    */
  829.  
  830. pascal ICError ICGetIndProfile(ICInstance inst, long index, ICProfileID *thisID)
  831. FIVEWORDINLINE(0x2F3C, 8, 40, 0x7000, 0xA82A);
  832.   /* [r3] [c1] [b1] 
  833.    * Returns the profile ID of the index'th profile.  index must be positive.
  834.    * Returns icProfileNotFoundErr if index is greater than the total number
  835.    * of profiles.
  836.    */
  837.  
  838. pascal ICError ICGetProfileName(ICInstance inst, ICProfileID thisID, Str255 name)
  839. FIVEWORDINLINE(0x2F3C, 8, 41, 0x7000, 0xA82A);
  840.   /* [r3] [c1] [b3] 
  841.    * Returns the name of a profile given its ID.  The name may not uniquely
  842.    * identify the profile.  [That's what the profile ID is for!]  The name
  843.    * is assumed to be in the system script.
  844.    */
  845.  
  846. pascal ICError ICSetProfileName(ICInstance inst, ICProfileID thisID, ConstStr255Param name)
  847. FIVEWORDINLINE(0x2F3C, 8, 42, 0x7000, 0xA82A);
  848.   /* [r3] [c1] [b3] 
  849.    * This routine sets the name of the specified profile.  Profile names
  850.    * need not be unique.  The name should be in the system script.
  851.    */
  852.  
  853. pascal ICError ICAddProfile(ICInstance inst, ICProfileID prototypeID, ICProfileID *newID)
  854. FIVEWORDINLINE(0x2F3C, 8, 43, 0x7000, 0xA82A);
  855.   /* [r3] [c1] [b2] 
  856.    * If prototypeID = kICNilProfileID, this routine
  857.    * creates a default profile, otherwise it creates a
  858.    * profile by cloning the prototype profile.  The ID
  859.    * of the new profile is returned in newID.
  860.    * The new profile will be give a new, unique, name.
  861.    * This does not switch to the new profile.
  862.    */
  863.  
  864. pascal ICError ICDeleteProfile(ICInstance inst, ICProfileID thisID)
  865. FIVEWORDINLINE(0x2F3C, 4, 44, 0x7000, 0xA82A);
  866.   /* [r3] [c1] [b2] 
  867.    * This routine deletes the profile specified by
  868.    * thisID.  Attempting to delete the current profile
  869.    * or the last profile will return error.
  870.    */
  871.  
  872. /* ***** Interrupt Safe Routines ***** */
  873.  
  874. pascal ICError ICRequiresInterruptSafe(ICInstance inst)
  875. FIVEWORDINLINE(0x2F3C, 0, 45, 0x7000, 0xA82A);
  876.   /* [r3] [c2] [b3] 
  877.    * You must call this routine before calling GetMapEntryInterruptSafe
  878.    * to give IC chance to cache the mappings data in memory.  The only
  879.    * way to clear this state is to close the instance.  You can not reconfigure
  880.    * the instance after calling this routine.
  881.    */
  882.  
  883. pascal ICError ICGetMappingInterruptSafe(ICInstance inst, Ptr *mappingPref, long *mappingPrefSize)
  884. FIVEWORDINLINE(0x2F3C, 8, 46, 0x7000, 0xA82A);
  885.   /* [r3] [c2] [b3] 
  886.    * Returns the "Mapping" preference in an interrupt safe fashion.
  887.    * The preference returned pointer is valid until the next
  888.    * non-interrupt safe call to IC.  Typically this API is used
  889.    * by software that needs to map extensions to type and creator
  890.    * at interrupt time, eg foreign file systems.
  891.    */
  892.  
  893. pascal ICError ICGetSeedInterruptSafe(ICInstance inst, long *seed)
  894. FIVEWORDINLINE(0x2F3C, 4, 48, 0x7000, 0xA82A);
  895.   /* [r3] [c2] [b3] 
  896.    * An interrupt safe version of ICGetSeed.
  897.    */
  898.  
  899.  
  900. /* •••End ICAPI.h••• */
  901.  
  902. #ifdef __cplusplus
  903. }
  904. #endif
  905.  
  906. enum {
  907.     kICComponentType = 'PREF',                            /* the component type */
  908.     kICComponentSubType = 'ICAp',                         /* the component subtype */
  909.     kICComponentManufacturer = 'JPQE',
  910.     kICComponentInterfaceVersion0 = 0x00000000L,        /* IC >= 1.0 */
  911.     kICComponentInterfaceVersion1 = 0x00010000L,        /* IC >= 1.1 */
  912.     kICComponentInterfaceVersion2 = 0x00020000L,        /* IC >= 1.2 */
  913.     kICComponentInterfaceVersion3 = 0x00030000L,        /* IC >= 2.0 */
  914.     /* current version number is version 3 */
  915.     kICComponentInterfaceVersion = kICComponentInterfaceVersion3
  916. };
  917.  
  918. #if OLDROUTINENAMES
  919.  
  920. /*    This definitions are a) very long, and b) don't conform
  921.     to Mac OS standards for naming constants, so I've put
  922.     them in only if you're using OLDROUTINENAMES.  Please switch
  923.     to the new names given above.
  924. */
  925.  
  926. enum {
  927.     internetConfigurationComponentType = 'PREF',                        /* the component type */
  928.     internetConfigurationComponentSubType = 'ICAp',                         /* the component subtype */
  929.     internetConfigurationComponentInterfaceVersion0 = 0x00000000L,        /* IC >= 1.0 */
  930.     internetConfigurationComponentInterfaceVersion1 = 0x00010000L,        /* IC >= 1.1 */
  931.     internetConfigurationComponentInterfaceVersion2 = 0x00020000L,        /* IC >= 1.2 */
  932.     internetConfigurationComponentInterfaceVersion3 = 0x00030000L,        /* IC >= 2.0 */
  933.     /* current version number is version 3 */
  934.     internetConfigurationComponentInterfaceVersion = internetConfigurationComponentInterfaceVersion3
  935. };
  936.  
  937. #endif
  938.  
  939. #if OLDROUTINENAMES
  940.  
  941. /*    The following type is now obsolete.  If you're using it,
  942.     please switch to using a ComponentInstance instead.
  943. */
  944.  
  945. typedef ComponentInstance internetConfigurationComponent;
  946.  
  947. #endif
  948.  
  949. enum {
  950. /* •••Start ICCSelectors.h••• */
  951.  
  952.     kICCStart = 0,
  953.     kICCStop = 1,
  954.     kICCFindConfigFile = 2,
  955.     kICCFindUserConfigFile = 14,
  956.     kICCGeneralFindConfigFile = 30,
  957.     kICCChooseConfig = 33,
  958.     kICCChooseNewConfig = 34,
  959.     kICCGetConfigName = 35,
  960.     kICCGetConfigReference = 31,
  961.     kICCSetConfigReference = 32,
  962.     kICCSpecifyConfigFile = 3,
  963.     kICCRefreshCaches = 47,
  964.     kICCGetSeed = 4,
  965.     kICCGetPerm = 13,
  966.     kICCDefaultFileName = 11,
  967.     kICCBegin = 5,
  968.     kICCGetPref = 6,
  969.     kICCSetPref = 7,
  970.     kICCFindPrefHandle = 36,
  971.     kICCGetPrefHandle = 26,
  972.     kICCSetPrefHandle = 27,
  973.     kICCCountPref = 8,
  974.     kICCGetIndPref = 9,
  975.     kICCDeletePref = 12,
  976.     kICCEnd = 10,
  977.     kICCEditPreferences = 15,
  978.     kICCParseURL = 16,
  979.     kICCLaunchURL = 17,
  980.     kICCMapFilename = 24,
  981.     kICCMapTypeCreator = 25,
  982.     kICCMapEntriesFilename = 28,
  983.     kICCMapEntriesTypeCreator = 29,
  984.     kICCCountMapEntries = 18,
  985.     kICCGetIndMapEntry = 19,
  986.     kICCGetMapEntry = 20,
  987.     kICCSetMapEntry = 21,
  988.     kICCDeleteMapEntry = 22,
  989.     kICCAddMapEntry = 23,
  990.     kICCGetCurrentProfile = 37,
  991.     kICCSetCurrentProfile = 38,
  992.     kICCCountProfiles = 39,
  993.     kICCGetIndProfile = 40,
  994.     kICCGetProfileName = 41,
  995.     kICCSetProfileName = 42,
  996.     kICCAddProfile = 43,
  997.     kICCDeleteProfile = 44,
  998.     kICCRequiresInterruptSafe = 45,
  999.     kICCGetMappingInterruptSafe = 46,
  1000.     kICCGetSeedInterruptSafe = 48,
  1001.   kICCFirstSelector = kICCStart,
  1002.   kICCLastSelector = 48
  1003.  
  1004. /* •••End ICCSelectors.h••• */
  1005. };
  1006.  
  1007. #ifdef __cplusplus
  1008. extern "C" {
  1009. #endif
  1010.  
  1011. /* •••Start ICCAPI.h••• */
  1012.  
  1013. /* ***** Starting Up and Shutting Down ***** */
  1014.  
  1015. pascal ICError ICCStart(ComponentInstance *inst, OSType creator);
  1016. /* See comment for ICCStart. */
  1017.  
  1018. pascal ICError ICCStop(ComponentInstance inst);
  1019. /* See comment for ICCStop. */
  1020.  
  1021. /* ***** Specifying a Configuration ***** */
  1022.  
  1023. pascal ICError ICCFindConfigFile(ComponentInstance inst, short count, ICDirSpecArrayPtr folders)
  1024. FIVEWORDINLINE(0x2F3C, 6, 2, 0x7000, 0xA82A);
  1025. /* See comment for ICCFindConfigFile. */
  1026.  
  1027. pascal ICError ICCFindUserConfigFile(ComponentInstance inst, ICDirSpec *where)
  1028. FIVEWORDINLINE(0x2F3C, 4, 14, 0x7000, 0xA82A);
  1029. /* See comment for ICCFindUserConfigFile. */
  1030.  
  1031. pascal ICError ICCGeneralFindConfigFile(ComponentInstance inst, Boolean searchPrefs, Boolean canCreate, short count, ICDirSpecArrayPtr folders)
  1032. FIVEWORDINLINE(0x2F3C, 10, 30, 0x7000, 0xA82A);
  1033. /* See comment for ICCGeneralFindConfigFile. */
  1034.  
  1035. pascal ICError ICCChooseConfig(ComponentInstance inst)
  1036. FIVEWORDINLINE(0x2F3C, 0, 33, 0x7000, 0xA82A);
  1037. /* See comment for ICCChooseConfig. */
  1038.  
  1039. pascal ICError ICCChooseNewConfig(ComponentInstance inst)
  1040. FIVEWORDINLINE(0x2F3C, 0, 34, 0x7000, 0xA82A);
  1041. /* See comment for ICCChooseNewConfig. */
  1042.  
  1043. pascal ICError ICCGetConfigName(ComponentInstance inst, Boolean longname, Str255 name)
  1044. FIVEWORDINLINE(0x2F3C, 6, 35, 0x7000, 0xA82A);
  1045. /* See comment for ICCGetConfigName. */
  1046.  
  1047. pascal ICError ICCGetConfigReference(ComponentInstance inst, ICConfigRefHandle ref)
  1048. FIVEWORDINLINE(0x2F3C, 4, 31, 0x7000, 0xA82A);
  1049. /* See comment for ICCGetConfigReference. */
  1050.  
  1051. pascal ICError ICCSetConfigReference(ComponentInstance inst, ICConfigRefHandle ref, long flags)
  1052. FIVEWORDINLINE(0x2F3C, 8, 32, 0x7000, 0xA82A);
  1053. /* See comment for ICCSetConfigReference. */
  1054.  
  1055. /* ***** Private Routines *****
  1056.  * 
  1057.  * If you are calling these routines, you are most probably doing something
  1058.  * wrong.  Please read the documentation for more details.
  1059.  */
  1060.  
  1061. pascal ICError ICCSpecifyConfigFile(ComponentInstance inst, FSSpec *config)
  1062. FIVEWORDINLINE(0x2F3C, 4, 3, 0x7000, 0xA82A);
  1063. /* See comment for ICCSpecifyConfigFile. */
  1064.  
  1065. pascal ICError ICCRefreshCaches(ComponentInstance inst)
  1066. FIVEWORDINLINE(0x2F3C, 0, 47, 0x7000, 0xA82A);
  1067. /* See comment for ICCRefreshCaches. */
  1068.  
  1069. /* ***** Getting Information ***** */
  1070.  
  1071. pascal ICError ICCGetSeed(ComponentInstance inst, long *seed)
  1072. FIVEWORDINLINE(0x2F3C, 4, 4, 0x7000, 0xA82A);
  1073. /* See comment for ICCGetSeed. */
  1074.  
  1075. pascal ICError ICCGetPerm(ComponentInstance inst, ICPerm *perm)
  1076. FIVEWORDINLINE(0x2F3C, 4, 13, 0x7000, 0xA82A);
  1077. /* See comment for ICCGetPerm. */
  1078.  
  1079. pascal ICError ICCDefaultFileName(ComponentInstance inst, Str63 name)
  1080. FIVEWORDINLINE(0x2F3C, 4, 11, 0x7000, 0xA82A);
  1081. /* See comment for ICCDefaultFileName. */
  1082.  
  1083. pascal ICError ICCGetComponentInstance(ComponentInstance inst, ComponentInstance *componentInst);
  1084. /* See comment for ICCGetComponentInstance. */
  1085.  
  1086. /* ***** Reading and Writing Preferences ***** */
  1087.  
  1088. pascal ICError ICCBegin(ComponentInstance inst, ICPerm perm)
  1089. FIVEWORDINLINE(0x2F3C, 2, 5, 0x7000, 0xA82A);
  1090. /* See comment for ICCBegin. */
  1091.  
  1092. pascal ICError ICCGetPref(ComponentInstance inst, ConstStr255Param key, ICAttr *attr, Ptr buf, long *size)
  1093. FIVEWORDINLINE(0x2F3C, 16, 6, 0x7000, 0xA82A);
  1094. /* See comment for ICCGetPref. */
  1095.  
  1096. pascal ICError ICCSetPref(ComponentInstance inst, ConstStr255Param key, ICAttr attr, Ptr buf, long size)
  1097. FIVEWORDINLINE(0x2F3C, 16, 7, 0x7000, 0xA82A);
  1098. /* See comment for ICCSetPref. */
  1099.  
  1100. pascal ICError ICCFindPrefHandle(ComponentInstance inst, ConstStr255Param key, ICAttr *attr, Handle prefh)
  1101. FIVEWORDINLINE(0x2F3C, 12, 36, 0x7000, 0xA82A);
  1102. /* See comment for ICCFindPrefHandle. */
  1103.  
  1104. pascal ICError ICCGetPrefHandle(ComponentInstance inst, ConstStr255Param key, ICAttr *attr, Handle *prefh)
  1105. FIVEWORDINLINE(0x2F3C, 12, 26, 0x7000, 0xA82A);
  1106. /* See comment for ICCGetPrefHandle. */
  1107.  
  1108. pascal ICError ICCSetPrefHandle(ComponentInstance inst, ConstStr255Param key, ICAttr attr, Handle prefh)
  1109. FIVEWORDINLINE(0x2F3C, 12, 27, 0x7000, 0xA82A);
  1110. /* See comment for ICCSetPrefHandle. */
  1111.  
  1112. pascal ICError ICCCountPref(ComponentInstance inst, long *count)
  1113. FIVEWORDINLINE(0x2F3C, 4, 8, 0x7000, 0xA82A);
  1114. /* See comment for ICCCountPref. */
  1115.  
  1116. pascal ICError ICCGetIndPref(ComponentInstance inst, long index, Str255 key)
  1117. FIVEWORDINLINE(0x2F3C, 8, 9, 0x7000, 0xA82A);
  1118. /* See comment for ICCGetIndPref. */
  1119.  
  1120. pascal ICError ICCDeletePref(ComponentInstance inst, ConstStr255Param key)
  1121. FIVEWORDINLINE(0x2F3C, 4, 12, 0x7000, 0xA82A);
  1122. /* See comment for ICCDeletePref. */
  1123.  
  1124. pascal ICError ICCEnd(ComponentInstance inst)
  1125. FIVEWORDINLINE(0x2F3C, 0, 10, 0x7000, 0xA82A);
  1126. /* See comment for ICCEnd. */
  1127.  
  1128. /* ***** User Interface Stuff ***** */
  1129.  
  1130. pascal ICError ICCEditPreferences(ComponentInstance inst, ConstStr255Param key)
  1131. FIVEWORDINLINE(0x2F3C, 4, 15, 0x7000, 0xA82A);
  1132. /* See comment for ICCEditPreferences. */
  1133.  
  1134. /* ***** URL Handling ***** */
  1135.  
  1136. pascal ICError ICCParseURL(ComponentInstance inst, ConstStr255Param hint, Ptr data, long len, long *selStart, long *selEnd, Handle url)
  1137. FIVEWORDINLINE(0x2F3C, 24, 16, 0x7000, 0xA82A);
  1138. /* See comment for ICCParseURL. */
  1139.  
  1140. pascal ICError ICCLaunchURL(ComponentInstance inst, ConstStr255Param hint, Ptr data, long len, long *selStart, long *selEnd)
  1141. FIVEWORDINLINE(0x2F3C, 20, 17, 0x7000, 0xA82A);
  1142. /* See comment for ICCLaunchURL. */
  1143.  
  1144. /* ***** Mappings Routines *****
  1145.  * 
  1146.  * Routines for interrogating mappings database.
  1147.  * 
  1148.  * ----- High Level Routines -----
  1149.  */
  1150.  
  1151. pascal ICError ICCMapFilename(ComponentInstance inst, ConstStr255Param filename, ICMapEntry *entry)
  1152. FIVEWORDINLINE(0x2F3C, 8, 24, 0x7000, 0xA82A);
  1153. /* See comment for ICCMapFilename. */
  1154.  
  1155. pascal ICError ICCMapTypeCreator(ComponentInstance inst, OSType fType, OSType fCreator, ConstStr255Param filename, ICMapEntry *entry)
  1156. FIVEWORDINLINE(0x2F3C, 16, 25, 0x7000, 0xA82A);
  1157. /* See comment for ICCMapTypeCreator. */
  1158.  
  1159. /* ----- Mid Level Routines ----- */
  1160.  
  1161. pascal ICError ICCMapEntriesFilename(ComponentInstance inst, Handle entries, ConstStr255Param filename, ICMapEntry *entry)
  1162. FIVEWORDINLINE(0x2F3C, 12, 28, 0x7000, 0xA82A);
  1163. /* See comment for ICCMapEntriesFilename. */
  1164.  
  1165. pascal ICError ICCMapEntriesTypeCreator(ComponentInstance inst, Handle entries, OSType fType, OSType fCreator, ConstStr255Param filename, ICMapEntry *entry)
  1166. FIVEWORDINLINE(0x2F3C, 20, 29, 0x7000, 0xA82A);
  1167. /* See comment for ICCMapEntriesTypeCreator. */
  1168.  
  1169. /* ----- Low Level Routines ----- */
  1170.  
  1171. pascal ICError ICCCountMapEntries(ComponentInstance inst, Handle entries, long *count)
  1172. FIVEWORDINLINE(0x2F3C, 8, 18, 0x7000, 0xA82A);
  1173. /* See comment for ICCCountMapEntries. */
  1174.  
  1175. pascal ICError ICCGetIndMapEntry(ComponentInstance inst, Handle entries, long index, long *pos, ICMapEntry *entry)
  1176. FIVEWORDINLINE(0x2F3C, 16, 19, 0x7000, 0xA82A);
  1177. /* See comment for ICCGetIndMapEntry. */
  1178.  
  1179. pascal ICError ICCGetMapEntry(ComponentInstance inst, Handle entries, long pos, ICMapEntry *entry)
  1180. FIVEWORDINLINE(0x2F3C, 12, 20, 0x7000, 0xA82A);
  1181. /* See comment for ICCGetMapEntry. */
  1182.  
  1183. pascal ICError ICCSetMapEntry(ComponentInstance inst, Handle entries, long pos, ICMapEntry *entry)
  1184. FIVEWORDINLINE(0x2F3C, 12, 21, 0x7000, 0xA82A);
  1185. /* See comment for ICCSetMapEntry. */
  1186.  
  1187. pascal ICError ICCDeleteMapEntry(ComponentInstance inst, Handle entries, long pos)
  1188. FIVEWORDINLINE(0x2F3C, 8, 22, 0x7000, 0xA82A);
  1189. /* See comment for ICCDeleteMapEntry. */
  1190.  
  1191. pascal ICError ICCAddMapEntry(ComponentInstance inst, Handle entries, ICMapEntry *entry)
  1192. FIVEWORDINLINE(0x2F3C, 8, 23, 0x7000, 0xA82A);
  1193. /* See comment for ICCAddMapEntry. */
  1194.  
  1195. /* ***** Profile Management Routines ***** */
  1196.  
  1197. pascal ICError ICCGetCurrentProfile(ComponentInstance inst, ICProfileID *currentID)
  1198. FIVEWORDINLINE(0x2F3C, 4, 37, 0x7000, 0xA82A);
  1199. /* See comment for ICCGetCurrentProfile. */
  1200.  
  1201. pascal ICError ICCSetCurrentProfile(ComponentInstance inst, ICProfileID newID)
  1202. FIVEWORDINLINE(0x2F3C, 4, 38, 0x7000, 0xA82A);
  1203. /* See comment for ICCSetCurrentProfile. */
  1204.  
  1205. pascal ICError ICCCountProfiles(ComponentInstance inst, long *count)
  1206. FIVEWORDINLINE(0x2F3C, 4, 39, 0x7000, 0xA82A);
  1207. /* See comment for ICCCountProfiles. */
  1208.  
  1209. pascal ICError ICCGetIndProfile(ComponentInstance inst, long index, ICProfileID *thisID)
  1210. FIVEWORDINLINE(0x2F3C, 8, 40, 0x7000, 0xA82A);
  1211. /* See comment for ICCGetIndProfile. */
  1212.  
  1213. pascal ICError ICCGetProfileName(ComponentInstance inst, ICProfileID thisID, Str255 name)
  1214. FIVEWORDINLINE(0x2F3C, 8, 41, 0x7000, 0xA82A);
  1215. /* See comment for ICCGetProfileName. */
  1216.  
  1217. pascal ICError ICCSetProfileName(ComponentInstance inst, ICProfileID thisID, ConstStr255Param name)
  1218. FIVEWORDINLINE(0x2F3C, 8, 42, 0x7000, 0xA82A);
  1219. /* See comment for ICCSetProfileName. */
  1220.  
  1221. pascal ICError ICCAddProfile(ComponentInstance inst, ICProfileID prototypeID, ICProfileID *newID)
  1222. FIVEWORDINLINE(0x2F3C, 8, 43, 0x7000, 0xA82A);
  1223. /* See comment for ICCAddProfile. */
  1224.  
  1225. pascal ICError ICCDeleteProfile(ComponentInstance inst, ICProfileID thisID)
  1226. FIVEWORDINLINE(0x2F3C, 4, 44, 0x7000, 0xA82A);
  1227. /* See comment for ICCDeleteProfile. */
  1228.  
  1229. /* ***** Interrupt Safe Routines ***** */
  1230.  
  1231. pascal ICError ICCRequiresInterruptSafe(ComponentInstance inst)
  1232. FIVEWORDINLINE(0x2F3C, 0, 45, 0x7000, 0xA82A);
  1233. /* See comment for ICCRequiresInterruptSafe. */
  1234.  
  1235. pascal ICError ICCGetMappingInterruptSafe(ComponentInstance inst, Ptr *mappingPref, long *mappingPrefSize)
  1236. FIVEWORDINLINE(0x2F3C, 8, 46, 0x7000, 0xA82A);
  1237. /* See comment for ICCGetMappingInterruptSafe. */
  1238.  
  1239. pascal ICError ICCGetSeedInterruptSafe(ComponentInstance inst, long *seed)
  1240. FIVEWORDINLINE(0x2F3C, 4, 48, 0x7000, 0xA82A);
  1241. /* See comment for ICCGetSeedInterruptSafe. */
  1242.  
  1243.  
  1244. /* •••End ICCAPI.h••• */
  1245.  
  1246. #ifdef __cplusplus
  1247. }
  1248. #endif
  1249.  
  1250. #if PRAGMA_ALIGN_SUPPORTED
  1251. #pragma options align=reset
  1252. #endif
  1253.  
  1254. #if PRAGMA_IMPORT_SUPPORTED
  1255. #pragma import off
  1256. #endif
  1257.  
  1258. #endif
  1259.